#pragma once
#include "..\\GDK\\DarkGDK_Classes.h"
#include "IBase.h"
#include "Effect.h"
#include <list>
#include <algorithm>
#include <vector>

class TGameObject : virtual public IBase
{        
    friend class GameEngine;
protected:    
    //TGameObject* m_objAttached;
    //TGameObject* m_objParent;
public:

    TGameObject() /*: m_objAttached(NULL),
                    m_objParent(NULL)*/
    {

    }
    virtual ~TGameObject()
    {
        
    }
    
    //void Attach(TGameObject *obj, int x, int y)
    //{
    //    TGDKSprite* sParent = GetMainSprite();
    //    TGDKSprite* sAttached = obj->GetMainSprite();
    //    if (sParent && sAttached)
    //    {
    //        sAttached->GetOffsetX(sTheir->GetWidth()/2 + x, sTheir->GetHeight()/2 + y);                        
    //        this->m_objAttached = obj;
    //        obj->m_objParent = this;
    //    }else{
    //        throw std::exception("Can't attach object. Sprite not exists");
    //    }
    //    m_objAttached = obj;
    //}

    //int GetX()
    //{
    //    return (m_objParent)?m_objParent->GetMainSprite()->GetX() + GetMainSprite()->GetOffsetX():GetMainSprite()->GetX();
    //}

    //int GetY()
    //{
    //    return (m_objParent)?m_objParent->GetMainSprite()->GetY() + GetMainSprite()->GetOffsetY():GetMainSprite()->GetY();
    //}

    virtual void OnDraw() = 0;

    virtual TGDKSprite* GetMainSprite() = 0;
};

//__declspec(selectany) TGameObject::GameObjectList TGameObject::ObjectsToAdd;
//
//__declspec(selectany) TGameObject::GameObjectList TGameObject::ObjectsToRemove;
//
//__declspec(selectany) TGameObject::GameObjectList TGameObject::Objects;
